package com.example.basic.base;


import com.example.basic.base.enums.LangTypeEnum;

import java.util.Locale;

/**
 * 全局变量
 */
public class Constants {

    // 系统默认编码
    public final static String ENCODING = "UTF-8";
    // 解压编码
    public final static String ZIPENCODING = "GBK";

    // 默认机构ID
    public final static long DEFAULT_ORG_ID = 1L;

    // 默认分页参数
    public final static int DEFAULT_PAGE = 1;
    public final static int DEFAULT_PAGE_SIZE = 12;
    // 排序方式
    public final static String ASC = "asc";
    public final static String DESC = "desc";

    // Jsonp Callback
    public final static String DEFAULT_JSONP_PARAM = "callback";
    public final static String DEFAULT_JSONP_CALLBACK_FUNCTION = "JSONP_CALLBACK";

    // 默认国际化相关全局变量定义
    // 默认语言
    public final static Locale DEFAULT_LOCALE = LangTypeEnum.getDefaultLangType().getLocale();
    public final static String DEFAULT_LANG = LangTypeEnum.getDefaultLangType().getType();
    // 默认文件大小限制
    // 单次请求
    public final static long MAX_FILE_SIZE = 1024 * 1024 * 1000;
    // 单个文件
    public final static long MAX_REQUEST_SIZE = 1024 * 1024 * 1000 * 2;

    // 默认加密密钥
    public final static String DEFAULT_SECRED_KEY = "c3VhbmNsb3Vk";

    // 字符串分隔符（页面请求如果参数是多个值，那默认用逗号分隔）
    public final static String STR_DELIMITER = ",";
    // 默认的分隔符（用于数据库数据存储）
    public final static String DELIMITER = "~|~";
    public static final String DELIMITER2 = "~~";
    public static final String DELIMITER3 = "~";
    public static final String DELIMITER4 = "/";

    public static final String DOT = ".";

    // 文件后缀名
    public static final String FILE_EXT_BAR = "bar";
    public static final String FILE_EXT_ZIP = "zip";

    public static final int STATIC_PAPER_INDEX = 1;

    public static final String ALL = "all";

    public static final String[] OPTION_SUFFIX = new String[]{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J"};

    // 默认的最大转换尝试次数
    public static final Integer MAX_CONVERT_ATTEMPT = 3;

    public static final int MAX_SHEET_ROWS = 1000;

    public final static String EXCEL_SUFFIX = ".xlsx";
    public final static String EXCEL_SUFFIX2 = ".xls";
    public static final String ZIP_SUFFIX = ".zip";

    public static final String FROM_QUE = "FROM-QUE";
    public static final String FROM_PAPER = "FROM-PAPER";

    public static final String FLOAT_FORMAT = "#####.#";

    public static final String BLANK_PLACEHOLDER = "{|*|}";

    public static final String FILL_BLANK_CASE_SENSITIVE = "1";
    public static final String FILL_BLANK_CASE_INSENSITIVE = "0";

    public static final int TRUE_IND = 1;
    public static final int FALSE_IND = 0;

    public static final int ERROR_CODE_11 = 11; //该机构编码对应的机构不存在或者还没启用;
    public static final int ERROR_CODE_12 = 12; //该机构编码对应的机构还没到启用时间
    public static final int ERROR_CODE_13 = 13; //该机构编码对应的机构已过期;

    public static final String ORG_ID = "orgId";
    public static final String ORG_CODE = "orgCode";

    public static final String AUTH_PREFIX = "LRN_ACTIVITY_";

    // 字符串分隔符 中文逗号
    public final static String STR_COMMA= "，";
    //斜杠 Slash
    public final static String SLASH = "/";
    //加号
    public static final String PLUS = "+";
}